<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>全栈进阶那些事 - 一只爱技术的程序猿，想把分享变成一种习惯！ </title><meta name="author" content="liuyuantao"><meta name="copyright" content="liuyuantao"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="一个有趣、有料、有内涵的地方!">
<meta property="og:type" content="website">
<meta property="og:title" content="全栈进阶那些事">
<meta property="og:url" content="https://liuyuantao.gitee.io/page/4/index.html">
<meta property="og:site_name" content="全栈进阶那些事">
<meta property="og:description" content="一个有趣、有料、有内涵的地方!">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://liuyuantao.gitee.io/img/zhiyao_avatar.jpg">
<meta property="article:author" content="liuyuantao">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://liuyuantao.gitee.io/img/zhiyao_avatar.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://liuyuantao.gitee.io/page/4/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?d43383137144f76a37f1074576bc674e";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":1,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"简"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":200},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: true,
    post: true
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":500,"languages":{"author":"作者: liuyuantao","link":"链接: ","source":"来源: 全栈进阶那些事","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'mediumZoom',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#2d3035","position":"top-right"},
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isanchor: true
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '全栈进阶那些事',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2021-11-23 18:55:57'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const fontSizeVal = saveToLocal.get('global-font-size')
    if (fontSizeVal !== undefined) {
      document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
    }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/atom.xml" title="全栈进阶那些事" type="application/atom+xml">
</head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/zhiyao_avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">41</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">14</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="not-top-img" id="page-header"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">全栈进阶那些事</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/11/07/3f8298fdea6c.html" title="异构存储（冷热数据分离）">     <img class="post_bg" src="https://oscimg.oschina.net/oscnet/up-70960f4ba467fd934e460b7a8c958819f2f.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="异构存储（冷热数据分离）"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/11/07/3f8298fdea6c.html" title="异构存储（冷热数据分离）">异构存储（冷热数据分离）</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-11-07T05:16:49.000Z" title="发表于 2020-11-07 13:16:49">2020-11-07</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%A4%A7%E6%95%B0%E6%8D%AE/">大数据</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Hadoop/">Hadoop</a></span></div><div class="content">异构存储主要解决不同的数据，存储在不同类型的硬盘中，达到最佳性能的问题。

异构存储Shell操作（1）查看当前有哪些存储策略可以用[lytfly@hadoop102 hadoop-3.1.4]$ hdfs storagepolicies -listPolicies

（2）为指定路径（数据存储目录）设置指定的存储策略hdfs storagepolicies -setStoragePolicy -path xxx -policy xxx

（3）获取指定路径（数据存储目录或文件）的存储策略hdfs storagepolicies -getStoragePolicy -path xxx

（4）取消存储策略；执行改命令之后该目录或者文件，以其上级的目录为准，如果是根目录，那么就是HOThdfs storagepolicies -unsetStoragePolicy -path xxx

（5）查看文件块的分布bin/hdfs fsck xxx -files -blocks -locations

（6）查看集群节点hadoop dfsadmin -report

配置文件信息（1）为ha ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/11/07/40a8b3f860f2.html" title="Hadoop企业开发案例调优场景">     <img class="post_bg" src="https://cdn.pixabay.com/photo/2021/10/21/08/14/italy-6728318__340.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hadoop企业开发案例调优场景"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/11/07/40a8b3f860f2.html" title="Hadoop企业开发案例调优场景">Hadoop企业开发案例调优场景</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-11-07T05:01:17.000Z" title="发表于 2020-11-07 13:01:17">2020-11-07</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%A4%A7%E6%95%B0%E6%8D%AE/">大数据</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Hadoop/">Hadoop</a></span></div><div class="content">需求（1）需求：从1G数据中，统计每个单词出现次数。服务器3台，每台配置4G内存，4核CPU，4线程。（2）需求分析：1G / 128m = 8个MapTask；1个ReduceTask；1个mrAppMaster平均每个节点运行10个 / 3台 ≈ 3个任务（4    3    3）
HDFS参数调优（1）修改：hadoop-env.shexport HDFS_NAMENODE_OPTS=&quot;-Dhadoop.security.logger=INFO,RFAS -Xmx1024m&quot;export HDFS_DATANODE_OPTS=&quot;-Dhadoop.security.logger=ERROR,RFAS -Xmx1024m&quot;

（2）修改hdfs-site.xml&lt;!-- NameNode有一个工作线程池，默认值是10 --&gt;&lt;property&gt;    &lt;name&gt;dfs.namenode.handler.count&lt;/name&gt;    &lt;value&gt;21&lt;/value&gt;&l ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/11/07/3a181e232503.html" title="Hadoop小文件优化方法">     <img class="post_bg" src="https://oscimg.oschina.net/oscnet/up-1681b15baa2d4bc66ceb813b9d6fcd4ad55.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hadoop小文件优化方法"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/11/07/3a181e232503.html" title="Hadoop小文件优化方法">Hadoop小文件优化方法</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-11-07T05:01:10.000Z" title="发表于 2020-11-07 13:01:10">2020-11-07</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%A4%A7%E6%95%B0%E6%8D%AE/">大数据</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Hadoop/">Hadoop</a></span></div><div class="content">Hadoop小文件弊端
每个文件均按块存储，每个块的元数据存储在NameNode的内存中，因此HDFS存储小文件会非常低效。因为大量的小文件会耗尽NameNode中的大部分内存。但注意，存储小文件所需要的磁盘容量和数据块的大小无关。例如，一个1MB的文件设置为128MB的块存储，实际使用的是1MB的磁盘空间，而不是128MB。
HDFS上每个文件都要在NameNode上创建对应的元数据，这个元数据的大小约为150byte，这样当小文件比较多的时候，就会产生很多的元数据文件，一方面会大量占用NameNode的内存空间，另一方面就是元数据文件过多，使得寻址索引速度变慢。小文件过多，在进行MR计算时，会生成过多切片，需要启动过多的MapTask。每个MapTask处理的数据量小，导致MapTask的处理时间比启动时间还小，白白消耗资源。
Hadoop小文件解决方案1）（数据源头）在数据采集的时候，就将小文件或小批数据合成大文件再上传HDFS
2）Hadoop Archive（存储方向）是一个高效的将小文件放入HDFS块中的文件存档工具，能够将多个小文件打包成一个HAR文件，从而达到减少Nam ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/11/07/9cc4868ea813.html" title="Hadoop-Yarn常用的调优参数">     <img class="post_bg" src="https://cdn.pixabay.com/photo/2021/08/08/10/34/ocean-6530523__340.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hadoop-Yarn常用的调优参数"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/11/07/9cc4868ea813.html" title="Hadoop-Yarn常用的调优参数">Hadoop-Yarn常用的调优参数</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-11-07T05:00:59.000Z" title="发表于 2020-11-07 13:00:59">2020-11-07</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%A4%A7%E6%95%B0%E6%8D%AE/">大数据</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Hadoop/">Hadoop</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/Yarn/">Yarn</a></span></div><div class="content">调优参数列表（1）Resourcemanager相关yarn.resourcemanager.scheduler.client.thread-count ResourceManager处理调度器请求的线程数量yarn.resourcemanager.scheduler.class   配置调度器

（2）Nodemanager相关yarn.nodemanager.resource.memory-mb                  NodeManager使用内存数yarn.nodemanager.resource.system-reserved-memory-mb  NodeManager为系统保留多少内存，和上一个参数二者取一即可yarn.nodemanager.resource.cpu-vcores   NodeManager使用CPU核数yarn.nodemanager.resource.count-logical-processors-as-cores   是否将虚拟核数当作CPU核数yarn.nodemanager.resource.pcores-vcores-multip ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/11/07/ec88b39f0ddd.html" title="安装Hive3.1.2">     <img class="post_bg" src="https://cdn.pixabay.com/photo/2021/10/14/13/50/book-6709160__340.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="安装Hive3.1.2"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/11/07/ec88b39f0ddd.html" title="安装Hive3.1.2">安装Hive3.1.2</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-11-07T04:58:52.000Z" title="发表于 2020-11-07 12:58:52">2020-11-07</time></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Hadoop/">Hadoop</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/Hive/">Hive</a></span></div><div class="content">下载地址：https://downloads.apache.org/hive/hive-3.1.2/
解压在指定目录
tar -zxvf /opt/software/apache-hive-3.1.2-bin.tar.gz -C /opt/module/mv /opt/module/apache-hive-3.1.2-bin/ /opt/module/hive3.1.2

修改/etc/profile.d/my_env.sh，添加环境变量
#HIVE_HOMEexport HIVE_HOME=/opt/module/hive3.1.2export PATH=$PATH:$HIVE_HOME/bin

3.1.2版本执行bin/schematool -dbType derby -initSchema的时候会报一个错误：
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]Exception in thread &quot;main&quot; java.lang.NoSuchMetho ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/11/07/fed9c14bf1ec.html" title="记一次HiveServer2启动不起来问题">     <img class="post_bg" src="https://oscimg.oschina.net/oscnet/up-d53b671bdbcd201845e0f686b5057858118.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="记一次HiveServer2启动不起来问题"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/11/07/fed9c14bf1ec.html" title="记一次HiveServer2启动不起来问题">记一次HiveServer2启动不起来问题</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-11-07T04:58:42.000Z" title="发表于 2020-11-07 12:58:42">2020-11-07</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%A4%A7%E6%95%B0%E6%8D%AE/">大数据</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Hadoop/">Hadoop</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/Hive/">Hive</a></span></div><div class="content">执行bin/hive –service hiveserver2等待30秒后，Hadoop已经退出安全模式
但是绑定的10000端口未成功。
各种原因都尝试了，还是不行，查看hive日志。
出现权限的问题，我也很纳闷。
java.lang.RuntimeException: Error applying authorization policy on hive configuration: The dir: /tmp/hive on HDFS should be writable. Current permissions are: rwx------


删除tmp目录后重新启动就可以了。
</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/11/07/b95db6da5460.html" title="使用DBeaver链接Hive">     <img class="post_bg" src="https://oscimg.oschina.net/oscnet/up-830071c62cea7713b5cce38b8701a0e2680.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="使用DBeaver链接Hive"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/11/07/b95db6da5460.html" title="使用DBeaver链接Hive">使用DBeaver链接Hive</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-11-07T04:55:59.000Z" title="发表于 2020-11-07 12:55:59">2020-11-07</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%A4%A7%E6%95%B0%E6%8D%AE/">大数据</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Hive/">Hive</a></span></div><div class="content">1.Hive开启HiveMetastore和HiveServer2
nohup /opt/module/hive3.1.2/bin/hive --service metastore &gt;$HIVE_LOG_DIR/metastore.log 2&gt;&amp;1 &amp;nohup /opt/module/hive3.1.2/bin/hive --service hiveserver2 &gt;$HIVE_LOG_DIR/hiveServer2.log 2&gt;&amp;1 &amp;

2.配置链接的用户名和密码
vim conf/hive-site.xml
&lt;property&gt;  &lt;name&gt;hive.server2.thrift.client.user&lt;/name&gt;  &lt;value&gt;lytfly&lt;/value&gt;  &lt;description&gt;Username to use against thrift client&lt;/description&gt;&lt;/property&gt;&lt;pro ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/11/07/4a3534643ea9.html" title="Spring Cloud全家桶主要组件及简要介绍">     <img class="post_bg" src="https://oscimg.oschina.net/oscnet/up-5e59cb5a26ed324a28f500d70fe4e642254.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Spring Cloud全家桶主要组件及简要介绍"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/11/07/4a3534643ea9.html" title="Spring Cloud全家桶主要组件及简要介绍">Spring Cloud全家桶主要组件及简要介绍</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-11-07T04:52:05.000Z" title="发表于 2020-11-07 12:52:05">2020-11-07</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Spring-SpringBoot/">Spring&amp;SpringBoot</a></span></div><div class="content">一、微服务简介
微服务是最近的一两年的时间里是很火的一个概念。感觉不学习一下都快跟不上时代的步伐了，下边做一下简单的总结和介绍。
何为微服务？简而言之，微服务架构风格这种开发方法，是以开发一组小型服务的方式来开发一个独立的应用系统的。其中每个小型服务都运行在自己的进程中，并经常采用HTTP资源API这样轻量的机制来相互通信。这些服务围绕业务功能进行构建，并能通过全自动的部署机制来进行独立部署。这些微服务可以使用不同的语言来编写，并且可以使用不同的数据存储技术。对这些微服务我们仅做最低限度的集中管理。
一个微服务一般完成某个特定的功能，比如下单管理、客户管理等等。每一个微服务都是微型六角形应用，都有自己的业务逻辑和适配器。一些微服务还会发布API给其它微服务和应用客户端使用。其它微服务完成一个Web UI，运行时，每一个实例可能是一个云VM或者是Docker容器。
比如，一个前面描述系统可能的分解如下：

总的来说，微服务的主旨是将一个原本独立的系统拆分成多个小型服务，这些小型服务都在各自独立的进程中运行，服务之间通过基于HTTP的RESTful API进行通信协作，并且每个服务都维护着 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/09/28/5425819fb73d.html" title="使用SecondaryNameNode恢复NameNode的数据">     <img class="post_bg" src="https://oscimg.oschina.net/oscnet/up-3b629c3742503f1d69ff7221c9ace166ee0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="使用SecondaryNameNode恢复NameNode的数据"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/09/28/5425819fb73d.html" title="使用SecondaryNameNode恢复NameNode的数据">使用SecondaryNameNode恢复NameNode的数据</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-09-28T05:15:11.000Z" title="发表于 2020-09-28 13:15:11">2020-09-28</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%A4%A7%E6%95%B0%E6%8D%AE/">大数据</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Hadoop/">Hadoop</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/HDFS/">HDFS</a></span></div><div class="content">
1）需求：NameNode进程挂了并且存储的数据也丢失了，如何恢复NameNode
此种方式恢复的数据可能存在小部分数据的丢失。
2）故障模拟（1）kill -9 NameNode进程
[lytfly@hadoop102 current]$ kill -9 19886

（2）删除NameNode存储的数据（/opt/module/hadoop-3.1.4/data/tmp/dfs/name）
[lytfly@hadoop102 hadoop-3.1.4]$ rm -rf /opt/module/hadoop-3.1.4/data/dfs/name/*

3）问题解决（1）拷贝SecondaryNameNode中数据到原NameNode存储数据目录
[lytfly@hadoop102 dfs]$ scp -r lytfly@hadoop104:/opt/module/hadoop-3.1.4/data/dfs/namesecondary/* ./name/

（2）重新启动NameNode
[lytfly@hadoop102 hadoop-3.1.4]$ hdfs --daemon  ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/09/07/f6e086c72cd4.html" title="Hadoop生态圈">     <img class="post_bg" src="https://static.oschina.net/uploads/space/2017/0525/091319_9tNE_2772739.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hadoop生态圈"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/09/07/f6e086c72cd4.html" title="Hadoop生态圈">Hadoop生态圈</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-09-07T05:34:27.000Z" title="发表于 2020-09-07 13:34:27">2020-09-07</time></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Hadoop/">Hadoop</a></span></div><div class="content">
</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/page/3/#content-inner"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/3/#content-inner">3</a><span class="page-number current">4</span><a class="page-number" href="/page/5/#content-inner">5</a><a class="extend next" rel="next" href="/page/5/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/zhiyao_avatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">liuyuantao</div><div class="author-info__description">一个有趣、有料、有内涵的地方!</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">41</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">14</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content"><p><strong style="color:#858585;font-size:20px;">扫描二维码,关注我们</strong><br/><span style="color:#49b1f5;">了解更多全栈技能!</span></p><img src="/img/qrcode_for_gh_da91cebd00cc_258.jpg"></div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2021/11/19/4e544b17c3ac.html" title="Nginx日志按天自动切割"><img src="https://cdn.pixabay.com/photo/2021/10/25/17/16/nature-6741602__340.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Nginx日志按天自动切割"/></a><div class="content"><a class="title" href="/2021/11/19/4e544b17c3ac.html" title="Nginx日志按天自动切割">Nginx日志按天自动切割</a><time datetime="2021-11-19T09:40:06.000Z" title="发表于 2021-11-19 17:40:06">2021-11-19</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/11/18/b4485f4970ce.html" title="ClickHouse新特性之SQL化用户配置"><img src="https://cdn.pixabay.com/photo/2017/01/31/18/21/books-2026194__340.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="ClickHouse新特性之SQL化用户配置"/></a><div class="content"><a class="title" href="/2021/11/18/b4485f4970ce.html" title="ClickHouse新特性之SQL化用户配置">ClickHouse新特性之SQL化用户配置</a><time datetime="2021-11-18T05:55:38.000Z" title="发表于 2021-11-18 13:55:38">2021-11-18</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/11/18/6d7187a575ff.html" title="MergeTree引擎的固定/自适应索引粒度"><img src="https://oscimg.oschina.net/oscnet/up-8479e16ac3738d1e8243838c11c9e96aba9.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="MergeTree引擎的固定/自适应索引粒度"/></a><div class="content"><a class="title" href="/2021/11/18/6d7187a575ff.html" title="MergeTree引擎的固定/自适应索引粒度">MergeTree引擎的固定/自适应索引粒度</a><time datetime="2021-11-18T05:52:18.000Z" title="发表于 2021-11-18 13:52:18">2021-11-18</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/11/18/23f3f36da036.html" title="无缝更改ClickHouse物化视图SELECT逻辑的方法"><img src="https://oscimg.oschina.net/oscnet/up-ac406843f42bfac15c16815aeb376bca9ad.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="无缝更改ClickHouse物化视图SELECT逻辑的方法"/></a><div class="content"><a class="title" href="/2021/11/18/23f3f36da036.html" title="无缝更改ClickHouse物化视图SELECT逻辑的方法">无缝更改ClickHouse物化视图SELECT逻辑的方法</a><time datetime="2021-11-18T05:43:50.000Z" title="发表于 2021-11-18 13:43:50">2021-11-18</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/11/18/fec2d399fcb4.html" title="物化视图简介与ClickHouse中的应用示例"><img src="https://upload-images.jianshu.io/upload_images/195230-462138b5b8e6e815.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="物化视图简介与ClickHouse中的应用示例"/></a><div class="content"><a class="title" href="/2021/11/18/fec2d399fcb4.html" title="物化视图简介与ClickHouse中的应用示例">物化视图简介与ClickHouse中的应用示例</a><time datetime="2021-11-18T05:31:13.000Z" title="发表于 2021-11-18 13:31:13">2021-11-18</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Spring-SpringBoot/"><span class="card-category-list-name">Spring&SpringBoot</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/"><span class="card-category-list-name">中间件</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%A4%A7%E6%95%B0%E6%8D%AE/"><span class="card-category-list-name">大数据</span><span class="card-category-list-count">34</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E8%BF%90%E7%BB%B4/"><span class="card-category-list-name">运维</span><span class="card-category-list-count">1</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/Hadoop/" style="font-size: 1.45em; color: rgb(29, 18, 195)">Hadoop</a><a href="/tags/HDFS/" style="font-size: 1.39em; color: rgb(67, 37, 146)">HDFS</a><a href="/tags/ClickHouse/" style="font-size: 1.27em; color: rgb(1, 73, 96)">ClickHouse</a><a href="/tags/Yarn/" style="font-size: 1.33em; color: rgb(150, 127, 36)">Yarn</a><a href="/tags/%E8%84%9A%E6%9C%AC/" style="font-size: 1.15em; color: rgb(88, 131, 138)">脚本</a><a href="/tags/Nginx/" style="font-size: 1.15em; color: rgb(178, 37, 116)">Nginx</a><a href="/tags/%E8%BF%90%E7%BB%B4/" style="font-size: 1.15em; color: rgb(128, 60, 172)">运维</a><a href="/tags/HBase/" style="font-size: 1.15em; color: rgb(0, 104, 140)">HBase</a><a href="/tags/%E4%B8%AD%E9%97%B4%E4%BB%B6/" style="font-size: 1.21em; color: rgb(40, 97, 23)">中间件</a><a href="/tags/Zookeeper/" style="font-size: 1.15em; color: rgb(40, 178, 154)">Zookeeper</a><a href="/tags/Hive/" style="font-size: 1.27em; color: rgb(147, 104, 22)">Hive</a><a href="/tags/Kafka/" style="font-size: 1.15em; color: rgb(176, 132, 95)">Kafka</a><a href="/tags/MapReduce/" style="font-size: 1.15em; color: rgb(157, 129, 39)">MapReduce</a><a href="/tags/Flume/" style="font-size: 1.15em; color: rgb(72, 148, 10)">Flume</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/11/"><span class="card-archive-list-date">十一月 2021</span><span class="card-archive-list-count">8</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/10/"><span class="card-archive-list-date">十月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/09/"><span class="card-archive-list-date">九月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/07/"><span class="card-archive-list-date">七月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2020/11/"><span class="card-archive-list-date">十一月 2020</span><span class="card-archive-list-count">27</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2020/09/"><span class="card-archive-list-date">九月 2020</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2019/11/"><span class="card-archive-list-date">十一月 2019</span><span class="card-archive-list-count">1</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">41</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2020-08-31T16:00:00.000Z"></div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">59.5k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2021-11-23T10:55:57.650Z"></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2021 By liuyuantao</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">扫描二维码,关注我们!了解更多全栈技能!<br/><img style="width:100px;height:100px;" src="/img/qrcode_for_gh_da91cebd00cc_258.jpg" ></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="font-plus" type="button" title="放大字体"><i class="fas fa-plus"></i></button><button id="font-minus" type="button" title="缩小字体"><i class="fas fa-minus"></i></button><button id="translateLink" type="button" title="简繁转换">简</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"></div><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>